#pragma once

#include "Any.h"
#include <memory>

class Result;  // 前置声明

class Task {
public:
    Task() = default;
    virtual ~Task() = default;

    virtual Any run() = 0;

    void setResult(const std::shared_ptr<Result>& result) { result_ = result; }

    void exec();

private:
    std::weak_ptr<Result> result_;
};